home *** CD-ROM | disk | FTP | other *** search
- Path: columba.udac.uu.se!evolution!thomas
- From: Thomas <thomas@evolution.bmc.uu.se>
- Newsgroups: comp.lang.c++
- Subject: Reverting of big array ?
- Date: Tue, 26 Mar 1996 13:34:48 +0100
- Organization: Uppsala University
- Message-ID: <Pine.SOL.3.91.960326132111.6385A-100000@evolution>
- NNTP-Posting-Host: evolution.bmc.uu.se
- Mime-Version: 1.0
- Content-Type: TEXT/PLAIN; charset=US-ASCII
- X-Sender: thomas@evolution
-
- I need to revert an array (of chars).
- I used the folowing code:( l=length of array)
-
- char *rev=new char[l+1];
- for(i=l-1,j=0;i>=0;i--,j++) rev[j]=seq[i];
- rev[j]='\0';
-
- this code works, but is terribly slow, when using an string with
- size ~ 6000.
- doing the same with the unix command 'rev' takes 1/2 second.
-
- Any ideas ???
-
- -thomas
-
- Sicheritz Ponten Thomas E. UPPSALA UNIVERSITY
- Vangsbyvaegen 128 S-740 20 Vaenge Biomedical Center
- Home: +46 18 364358 Department of Molecular Biology
- BMC: +46 18 174379 BOX 590 S-751 24 UPPSALA Sweden
- Fax +46 18 557723 http://skydancer.bmc.uu.se/~thomas
-
- Chaos always defeats order,
- because it is better organized.
- (Terry Pratchett)
-
-